import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  OneToMany,
  ManyToOne,
} from 'typeorm'
import { CategoryValueEntity } from './categoryValue.entity'

@Entity('category')
export class CategoryEntity {
  @PrimaryGeneratedColumn()
  id: number

  @Column()
  name: string

  @OneToMany(
    () => CategoryValueEntity,
    categoryValueEntity => categoryValueEntity.parent,
  )
  categoryValue: CategoryValueEntity[]
}
